* [PATCH] disassembly fixes
@ 2003-04-07 13:24 Elena Zannoni
2003-04-07 13:32 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Elena Zannoni @ 2003-04-07 13:24 UTC (permalink / raw)
To: gdb-patches
A few fixes for the new disassembler. I'll commit in a day or so.
2003-04-04 Elena Zannoni <ezannoni@redhat.com>
* disasm.c (dump_insns): Move variables inside loop, or they will
be freed more than once, causing wild memory corruptions.
(gdb_disassembly): Look for the substring "-thread",
instead of "-threads" in the target name, to make sure to find
the 'multi-thread' target. Also, make sure we do the right thing
with the "core" target.
Index: disasm.c
===================================================================
RCS file: /cvs/uberbaum/gdb/disasm.c,v
retrieving revision 1.5
diff -u -p -r1.5 disasm.c
--- disasm.c 17 Mar 2003 19:57:12 -0000 1.5
+++ disasm.c 4 Apr 2003 22:56:46 -0000
@@ -93,14 +93,15 @@ dump_insns (struct ui_out *uiout, disass
/* parts of the symbolic representation of the address */
int unmapped;
- char *filename = NULL;
- char *name = NULL;
int offset;
int line;
struct cleanup *ui_out_chain;
for (pc = low; pc < high;)
{
+ char *filename = NULL;
+ char *name = NULL;
+
QUIT;
if (how_many >= 0)
{
@@ -358,7 +359,8 @@ gdb_disassembly (struct ui_out *uiout,
if (strcmp (target_shortname, "child") == 0
|| strcmp (target_shortname, "procfs") == 0
|| strcmp (target_shortname, "vxprocess") == 0
- || strstr (target_shortname, "-threads") != NULL)
+ || strcmp (target_shortname, "core") == 0
+ || strstr (target_shortname, "-thread") != NULL)
gdb_disassemble_from_exec = 0; /* It's a child process, read inferior mem */
else
gdb_disassemble_from_exec = 1; /* It's remote, read the exec file */
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] disassembly fixes
2003-04-07 13:24 [PATCH] disassembly fixes Elena Zannoni
@ 2003-04-07 13:32 ` Daniel Jacobowitz
2003-04-07 14:26 ` Elena Zannoni
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2003-04-07 13:32 UTC (permalink / raw)
To: gdb-patches
On Fri, Apr 04, 2003 at 06:04:48PM -0500, Elena Zannoni wrote:
>
> A few fixes for the new disassembler. I'll commit in a day or so.
>
> 2003-04-04 Elena Zannoni <ezannoni@redhat.com>
>
> * disasm.c (dump_insns): Move variables inside loop, or they will
> be freed more than once, causing wild memory corruptions.
> (gdb_disassembly): Look for the substring "-thread",
> instead of "-threads" in the target name, to make sure to find
> the 'multi-thread' target. Also, make sure we do the right thing
> with the "core" target.
While you're in there, any comments on:
http://sources.redhat.com/ml/gdb/2003-02/msg00153.html
?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] disassembly fixes
2003-04-07 13:32 ` Daniel Jacobowitz
@ 2003-04-07 14:26 ` Elena Zannoni
2003-04-07 18:50 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Elena Zannoni @ 2003-04-07 14:26 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz writes:
> On Fri, Apr 04, 2003 at 06:04:48PM -0500, Elena Zannoni wrote:
> >
> > A few fixes for the new disassembler. I'll commit in a day or so.
> >
> > 2003-04-04 Elena Zannoni <ezannoni@redhat.com>
> >
> > * disasm.c (dump_insns): Move variables inside loop, or they will
> > be freed more than once, causing wild memory corruptions.
> > (gdb_disassembly): Look for the substring "-thread",
> > instead of "-threads" in the target name, to make sure to find
> > the 'multi-thread' target. Also, make sure we do the right thing
> > with the "core" target.
>
> While you're in there, any comments on:
> http://sources.redhat.com/ml/gdb/2003-02/msg00153.html
> ?
>
Hmm, yes, I think that logic is a bit screwed up (it came from gdbtk,
and maybe there it was more appropriate), I have no objections if you
want to revisit the heuristics. n hte meantime I would apply these
changes anyway because disassembly with core files and threaded
programs just doesn't work at all.
elena
> --
> Daniel Jacobowitz
> MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] disassembly fixes
2003-04-07 14:26 ` Elena Zannoni
@ 2003-04-07 18:50 ` Daniel Jacobowitz
2003-04-08 1:41 ` Elena Zannoni
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2003-04-07 18:50 UTC (permalink / raw)
To: Elena Zannoni; +Cc: gdb-patches
On Mon, Apr 07, 2003 at 09:31:08AM -0400, Elena Zannoni wrote:
> Daniel Jacobowitz writes:
> > On Fri, Apr 04, 2003 at 06:04:48PM -0500, Elena Zannoni wrote:
> > >
> > > A few fixes for the new disassembler. I'll commit in a day or so.
> > >
> > > 2003-04-04 Elena Zannoni <ezannoni@redhat.com>
> > >
> > > * disasm.c (dump_insns): Move variables inside loop, or they will
> > > be freed more than once, causing wild memory corruptions.
> > > (gdb_disassembly): Look for the substring "-thread",
> > > instead of "-threads" in the target name, to make sure to find
> > > the 'multi-thread' target. Also, make sure we do the right thing
> > > with the "core" target.
> >
> > While you're in there, any comments on:
> > http://sources.redhat.com/ml/gdb/2003-02/msg00153.html
> > ?
> >
>
> Hmm, yes, I think that logic is a bit screwed up (it came from gdbtk,
> and maybe there it was more appropriate), I have no objections if you
> want to revisit the heuristics. n hte meantime I would apply these
> changes anyway because disassembly with core files and threaded
> programs just doesn't work at all.
Sounds good to me!
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] disassembly fixes
2003-04-07 18:50 ` Daniel Jacobowitz
@ 2003-04-08 1:41 ` Elena Zannoni
0 siblings, 0 replies; 5+ messages in thread
From: Elena Zannoni @ 2003-04-08 1:41 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Elena Zannoni, gdb-patches
Daniel Jacobowitz writes:
> On Mon, Apr 07, 2003 at 09:31:08AM -0400, Elena Zannoni wrote:
> > Daniel Jacobowitz writes:
> > > On Fri, Apr 04, 2003 at 06:04:48PM -0500, Elena Zannoni wrote:
> > > >
> > > > A few fixes for the new disassembler. I'll commit in a day or so.
> > > >
> > > > 2003-04-04 Elena Zannoni <ezannoni@redhat.com>
> > > >
> > > > * disasm.c (dump_insns): Move variables inside loop, or they will
> > > > be freed more than once, causing wild memory corruptions.
> > > > (gdb_disassembly): Look for the substring "-thread",
> > > > instead of "-threads" in the target name, to make sure to find
> > > > the 'multi-thread' target. Also, make sure we do the right thing
> > > > with the "core" target.
> > >
> > > While you're in there, any comments on:
> > > http://sources.redhat.com/ml/gdb/2003-02/msg00153.html
> > > ?
> > >
> >
> > Hmm, yes, I think that logic is a bit screwed up (it came from gdbtk,
> > and maybe there it was more appropriate), I have no objections if you
> > want to revisit the heuristics. n hte meantime I would apply these
> > changes anyway because disassembly with core files and threaded
> > programs just doesn't work at all.
>
> Sounds good to me!
ok, applied.
elena
>
> --
> Daniel Jacobowitz
> MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-04-08 1:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-07 13:24 [PATCH] disassembly fixes Elena Zannoni
2003-04-07 13:32 ` Daniel Jacobowitz
2003-04-07 14:26 ` Elena Zannoni
2003-04-07 18:50 ` Daniel Jacobowitz
2003-04-08 1:41 ` Elena Zannoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox