SHA256
1
0
forked from pool/gdb
Files
gdb/gdb-bz645773-case-insensitive-2of5.patch
Sascha Peilicke ab51a8efb0 Accepting request 78265 from devel:gcc
- Merge from gdb-7.3-41.fc15.src.rpm.  [fate#310741]
  * Tue Jul 26 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.3-41.fc15
  - Rebase to the final FSF GDB 7.3 release.
  - Improve gcc-4.6 stdarg false prologue end workaround (GDB PR 12435 + GCC PR 47471).
  
  * Sun Jul  3 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110703-40.fc15
  - Rebase to FSF GDB 7.2.90.20110703 (which is a 7.3 pre-release).
    - Adjust the `print errno' patch due to the DW_AT_linkage_name following again.
  
  * Fri Jun 24 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110525-39.fc15
  - Fix install-info for the gdb-doc subpackage (BZ 715228).

- Merge from gdb-7.2.90.20110525-38.fc15.src.rpm.  [fate#310741]
  * Wed May 25 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110525-38.fc15
  - Rebase to FSF GDB 7.2.90.20110525 (which is a 7.3 pre-release).
  - [stap] Fix double free (Sergio Durigan Junior).
  
  * Tue May  3 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110429-37.fc15
  - Search also for .<seqno> files in /usr/lib/debug/.build-id (BZ 641377).

- Merge from gdb-7.2.90.20110429-36.fc15.src.rpm.
  * Mon May  2 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110429-36.fc15
  - Bundle readline-6.2 with a workaround of skipped "ask" (BZ 701131).
    - Use --without-system-readline, disable Requires and BuildRequires of readline.
    - Drop gdb-6.5-readline-long-line-crash.patch and gdb-readline-6.0-signal.patch.
  
  * Fri Apr 29 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.90.20110429-35.fc15
  - Rebase to FSF GDB 7.2.90.20110429 (which is a 7.3 pre-release).
  - Fix -O2 -g breakpoints internal error + prologue skipping (BZ 612253).
  - Fix case insensitive symbols for Fortran by iFort (BZ 645773).

OBS-URL: https://build.opensuse.org/request/show/78265
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gdb?expand=0&rev=85
2011-08-11 13:47:36 +00:00

140 lines
3.2 KiB
Diff

http://sourceware.org/ml/gdb-patches/2011-04/msg00124.html
Subject: [patch 1/3] case insensitive: Reformat code
Hi,
just some reformatting to make the later patch more clear. There should be no
functionality difference by this patch. c1+c2 are a bit ugly but I found any
other solution a bit ugly.
Thanks,
Jan
gdb/
2011-04-08 Jan Kratochvil <jan.kratochvil@redhat.com>
Format the code for the next patch.
* dwarf2read.c (struct mapped_index): Include delimiting newlines.
* utils.c (strcmp_iw_ordered): Reformat the code for the next patch.
New variables c1 and c2.
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -150,14 +150,19 @@ struct mapped_index
{
/* The total length of the buffer. */
off_t total_size;
+
/* A pointer to the address table data. */
const gdb_byte *address_table;
+
/* Size of the address table data in bytes. */
offset_type address_table_size;
+
/* The symbol table, implemented as a hash table. */
const offset_type *symbol_table;
+
/* Size in slots, each slot is 2 offset_types. */
offset_type symbol_table_slots;
+
/* A pointer to the constant pool. */
const char *constant_pool;
};
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -3023,48 +3023,55 @@ strcmp_iw (const char *string1, const char *string2)
int
strcmp_iw_ordered (const char *string1, const char *string2)
{
- while ((*string1 != '\0') && (*string2 != '\0'))
+ /* Formatting stub. */
+ if (1)
{
- while (isspace (*string1))
- {
- string1++;
- }
- while (isspace (*string2))
- {
- string2++;
- }
- if (*string1 != *string2)
+ /* C1 and C2 are valid only if *string1 != '\0' && *string2 != '\0'.
+ Provide stub characters if we are already at the end of one of the
+ strings. */
+ char c1 = 'X', c2 = 'X';
+
+ while (*string1 != '\0' && *string2 != '\0')
{
- break;
+ while (isspace (*string1))
+ string1++;
+ while (isspace (*string2))
+ string2++;
+
+ c1 = *string1;
+ c2 = *string2;
+ if (c1 != c2)
+ break;
+
+ if (*string1 != '\0')
+ {
+ string1++;
+ string2++;
+ }
}
- if (*string1 != '\0')
+
+ switch (*string1)
{
- string1++;
- string2++;
+ /* Characters are non-equal unless they're both '\0'; we want to
+ make sure we get the comparison right according to our
+ comparison in the cases where one of them is '\0' or '('. */
+ case '\0':
+ if (*string2 == '\0')
+ return 0;
+ else
+ return -1;
+ case '(':
+ if (*string2 == '\0')
+ return 1;
+ else
+ return -1;
+ default:
+ if (*string2 == '\0' || *string2 == '(')
+ return 1;
+ else
+ return c1 - c2;
}
}
-
- switch (*string1)
- {
- /* Characters are non-equal unless they're both '\0'; we want to
- make sure we get the comparison right according to our
- comparison in the cases where one of them is '\0' or '('. */
- case '\0':
- if (*string2 == '\0')
- return 0;
- else
- return -1;
- case '(':
- if (*string2 == '\0')
- return 1;
- else
- return -1;
- default:
- if (*string2 == '(')
- return 1;
- else
- return *string1 - *string2;
- }
}
/* A simple comparison function with opposite semantics to strcmp. */